﻿using System;
using System.Linq;
using System.Reflection;

namespace InterfaceLiftLib.Extensions
{
    public static class ParameterInfoExtensions
    {
        public static bool TryGetCustomAttribute<T>(this ParameterInfo pi, out T attribute) where T : Attribute
        {
            attribute = pi.GetCustomAttributes(typeof(T), false).FirstOrDefault() as T;
            return attribute != null;
        }
    }
}
